package com.fzg.common.config;

import com.fzg.common.interceptor.MyInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * create by fzg
 * 2021/10/12 12:02
 */

@Component
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/wangyiyun/**")
                .excludePathPatterns("/user/register")
                .excludePathPatterns("/user/checkUserName")
                .excludePathPatterns("/user/checkPhone")
                .excludePathPatterns("/user/login")
                .excludePathPatterns("/user/getData")
                .excludePathPatterns("/country-name/*")
                .excludePathPatterns("/china-province/*")
                .excludePathPatterns("/china-province-city/*")
                .excludePathPatterns("/gedan/**")
        ;
    }
}
